const promise1 = new Promise((resolve, reject) => {
    setTimeout(() => {
        resolve('success')
    }, 1000)
})

const promise2 = promise1.then(() => {
    throw new Error('error')
    // Promise.reject('error')
})

console.log('promise1', promise1); // promise{<pending>}
console.log('promise2', promise2); // promise{<pending>}


setTimeout(() => {
console.log('promise1', promise1); // promise{<resolved>}
console.log('promise2', promise2); // promise{<reject>}
}, 2000) // 时间，剩余的一秒钟相当于异步
